import { Observable } from 'rxjs'
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/map';

var button = document.querySelector('button');

// Observable.fromEvent(button, 'click')
//     .scan((count:number) => count + 1, 0)
//     .subscribe(count => console.log(`Clicked ${count} times`));
function isLogin():Observable<boolean> {
  var observable = Observable.create(function (observer) {
      observer.next(true);
      observer.complete();
  });
  return observable;
}


console.log('just before subscribe');
var obs = isLogin();
obs.subscribe(res => {
  console.log('got value ' + res);
});

